﻿namespace Server
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.Web;

    [DataContract]
    public class ProductView
    {

        #region INullable Members

        private bool m_Null = false;

        public bool IsNull
        {
            get { return this.m_Null; }
        }

        public static ProductView Null
        {
            get
            {
                return new ProductView(0)
                {
                    m_Null = true
                };
            }
        }

        #endregion

        /// <summary>
        /// Id товара
        /// </summary>
        [DataMember]
        public long Id { get; private set; }

        /// <summary>
        /// Category identifier
        /// </summary>
        [DataMember]
        public int CategoryId { get; set; }

        /// <summary>
        /// Цена товара
        /// </summary>
        [DataMember]
        public decimal Price { get; set; }

        /// <summary>
        /// Product photo
        /// </summary>
        [DataMember]
        public string Photo { get; set; }

        /// <summary>
        /// Название товара
        /// </summary>
        [DataMember]
        public string Name { get; set; }

        /// <summary>
        /// Количество товара
        /// </summary>
        [DataMember]
        public int Count { get; set; }

        /// <summary>
        /// Конструктор
        /// </summary>
        /// <param name="id">Id товара</param>
        public ProductView(long id)
        {
            this.Id = id;
        }
    }
}